package cn.iocoder.yudao.module.sys.dal.mysql.instrumentoperationlog;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.sys.dal.dataobject.instrumentoperationlog.InstrumentOperationLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.sys.controller.admin.instrumentoperationlog.vo.*;

/**
 * 仪器设备操作记录表（记录新增、修改、删除、出库、入库操作，支持追溯） Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface InstrumentOperationLogMapper extends BaseMapperX<InstrumentOperationLogDO> {

    default PageResult<InstrumentOperationLogDO> selectPage(InstrumentOperationLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InstrumentOperationLogDO>()
                .eqIfPresent(InstrumentOperationLogDO::getInstrumentId, reqVO.getInstrumentId())
                .eqIfPresent(InstrumentOperationLogDO::getOperationType, reqVO.getOperationType())
                .eqIfPresent(InstrumentOperationLogDO::getOperatorId, reqVO.getOperatorId())
                .likeIfPresent(InstrumentOperationLogDO::getOperatorName, reqVO.getOperatorName())
                .betweenIfPresent(InstrumentOperationLogDO::getOperationTime, reqVO.getOperationTime())
                .eqIfPresent(InstrumentOperationLogDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(InstrumentOperationLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(InstrumentOperationLogDO::getId));
    }

}